import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, Relation } from "typeorm";
import { Photo } from './Photo'

@Entity()
export class PhotoMetadata { 

  @PrimaryGeneratedColumn()
  id: number

  @Column("int")
  height: number

  @Column("int")
  width: number

  @Column()
  orientation: string

  @Column()
  compressed: boolean

  @Column()
  comment: string

  @OneToOne(() => Photo, (photo) => photo.metadata)
  @JoinColumn({ name: 'photo_id' })
  photo: Relation<Photo>

}

